@import './reset.less';
@import './animate.less';
@import './layout.less';

*, *::after, *::before {
	-webkit-user-drag: none;
}

html {
  font-size: 16px;
}

.nobreak {
  white-space: nowrap;
}

.auto-hidden {
  .mixin-ellipsis-1;
}

.center {
  text-align: center;
}

.break {
  word-break: break-all;
}

.select {
  user-select: text;
}
.no-select {
  user-select: none;
}

.thead {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  overflow: hidden;
  color: @color-theme_2-font;
  th {
    font-size: 12px;
    text-align: left;
    line-height: 38px;
    padding: 0 6px;
  }
  tbody {
    tr {
      // border-top: 1px solid rgba(0, 0, 0, 0.12);
      transition: background-color 0.2s ease;
      + tr {
        border-top: 1px solid @color-theme_2-line;
      }
      &:hover {
        background-color: @color-theme_2-hover;
      }
      &.active {
        background-color: @color-theme_2-active;
      }
      &.selected {
        background-color: @color-theme_2-hover;
      }
      td {
        padding: 6px;
        position: relative;
        transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 13px;
        line-height: 16px;
        vertical-align: middle;
      }
    }
  }
}

.list {
  width: 100%;
  overflow: hidden;
  color: @color-theme_2-font;
  .list-item {
    height: 100%;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    // border-top: 1px solid rgba(0, 0, 0, 0.12);
    transition: background-color 0.2s ease;
    border-bottom: 1px solid @color-theme_2-line;
    box-sizing: border-box;
    &:hover {
      background-color: @color-theme_2-hover;
    }
    &.active {
      background-color: @color-theme_2-active;
    }
    &.selected {
      background-color: @color-theme_2-hover;
    }
    .list-item-cell {
      flex: none;
      padding: 0 6px;
      position: relative;
      transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      font-size: 13px;
      line-height: 16px;
      vertical-align: middle;
      box-sizing: border-box;
      .mixin-ellipsis-1;

      &.auto {
        flex: auto;
      }
    }
  }
}

.badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: .7em;
  // font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 2px;

  &.badge-light {
    background-color: #f8f9fa;
  }
  &.badge-secondary {
    color: #fff;
    background-color: #6c757d;
  }
  &.badge-info {
    color: #fff;
    background-color: #4baed5;
  }
  &.badge-warning {
    color: #fff;
    background-color: #ffa45a;
  }
  &.badge-danger {
    color: #fff;
    background-color: #ff705a;
  }
  &.badge-success {
    color: #fff;
    background-color: #32bc63;
  }
  &.badge-theme-success {
    color: @color-badge-success-font;
    background-color: @color-badge-success;
  }
  &.badge-theme-info {
    color: @color-badge-info-font;
    background-color: @color-badge-info;
  }
}

small {
  font-size: .8em;
}
.small {
  font-size: .9em;
}
.tip {
  color: @color-theme_2-font-label;
}
strong {
  font-weight: bold;
}

.underline {
  text-decoration: underline;
}

svg {
  transition: @transition-theme;
  transition-property: fill;
}

button, input, textarea, a {
  color: @color-theme_2-font;
}

input, textarea {
  &::placeholder {
    color: @color-theme_2-font-label;
  }
}
::selection {
  color: @color-theme_2;
  background: @color-btn;
}

.hover, a {
  cursor: pointer;
  transition: color .2s ease;
  &:hover {
    color: @color-theme;
  }
  &:active {
    color: @color-theme-active;
  }
}

.scroll {
  overflow: auto;
  &::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: rgba(0, 0, 0, 0);
  }
  &::-webkit-scrollbar-track {
    background-color: @color-scrollbar-track;
    border-radius: 3px;
    // background-color: rgba(0, 0, 0, 0.1);
  }
  &::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background-color: @color-scrollbar-thumb;
    // background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
  }
  &::-webkit-scrollbar-thumb:hover {
    border-radius: 3px;
    background-color: @color-scrollbar-thumb-hover;
    // background-color: rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
  }
}

.gap-left {
  + .gap-left {
    margin-left: 20px;
  }
}
.gap-top {
  &.top {
    margin-top: 25px;
  }

  + .gap-top {
    margin-top: 10px;
  }
}

/*
#waiting-mask {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 999999;
  transition: all .8s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-app-region: drag;
  background-color: @color-theme;

  &.hide {
    opacity: 0;
  }
}
#logo-path-1 {fill: #5ed698; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));}
#logo-path-2 {fill: #4daf7c; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));}


each(@themes, {
  body.@{value} #waiting-mask {
    background-color: ~'@{color-@{value}-theme_2-background_1}';

    #logo-path-1 {fill: ~'@{color-@{value}-btn}'; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));}
    #logo-path-2 {fill: ~'@{color-@{value}-theme}'; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));}
  }
}) */
// each(@themes, {
//   body.@{value} #waiting-mask {
//     background-color: ~'@{color-@{value}-theme}';

//     #logo-path-1 {fill: ~'@{color-@{value}-theme_2-background_1}'; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));}
//     #logo-path-2 {fill: ~'@{color-@{value}-theme-font-label}'; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));}
//   }
// })

each(@themes, {
  #root.@{value} {
    button, input, textarea, a {
      color: ~'@{color-@{value}-theme_2-font}';
    }
    .tip {
      color: ~'@{color-@{value}-theme_2-font-label}';
    }

    .hover, a {
      &:hover {
        color: ~'@{color-@{value}-theme}';
      }
      &:active {
        color: ~'@{color-@{value}-theme-active}';
      }
    }
    .scroll {
      &::-webkit-scrollbar {
        background-color: rgba(0, 0, 0, 0);
      }
      &::-webkit-scrollbar-track {
        background-color: ~'@{color-@{value}-scrollbar-track}';
      }
      &::-webkit-scrollbar-thumb {
        background-color: ~'@{color-@{value}-scrollbar-thumb}';
      }
      &::-webkit-scrollbar-thumb:hover {
        background-color: ~'@{color-@{value}-scrollbar-thumb-hover}';
      }
    }
    table {
      color: ~'@{color-@{value}-theme_2-font}';

      tbody {
        tr {
          border-top-color: ~'@{color-@{value}-theme_2-line}';
          &:hover {
            background-color: ~'@{color-@{value}-theme_2-hover}';
          }
          &.active {
            background-color: ~'@{color-@{value}-theme_2-active}';
          }
          &.selected {
            background-color: ~'@{color-@{value}-theme_2-hover}';
          }
        }
      }
    }

    .list {
      color: ~'@{color-@{value}-theme_2-font}';
      .list-item {
        border-bottom-color: ~'@{color-@{value}-theme_2-line}';
        &:hover {
          background-color: ~'@{color-@{value}-theme_2-hover}';
        }
        &.active {
          background-color: ~'@{color-@{value}-theme_2-active}';
        }
        &.selected {
          background-color: ~'@{color-@{value}-theme_2-hover}';
        }
      }
    }

    input, textarea {
      &::placeholder {
        color: ~'@{color-@{value}-theme_2-font-label}';
      }
    }
    ::selection {
      color: ~'@{color-@{value}-theme_2}';
      background: ~'@{color-@{value}-btn}';
    }

    .badge {
      &.badge-theme-success {
        color: ~'@{color-@{value}-badge-success-font}';
        background-color: ~'@{color-@{value}-badge-success}';
      }
      &.badge-theme-info {
        color: ~'@{color-@{value}-badge-info-font}';
        background-color: ~'@{color-@{value}-badge-info}';
      }
    }
  }
})
